package com.mdd.admin.validate.log;

import com.mdd.common.validator.annotation.IDMust;
import com.mdd.common.validator.annotation.IntegerContains;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import lombok.Data;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * 短信发送记录参数
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class SmsLogParam implements Serializable {

    private static final long serialVersionUID = 1L;

    public interface create{}
    public interface update{}
    public interface delete{}

    @IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Long id;

    @NotNull(message = "sceneId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "sceneId参数值不能少于0", groups = {create.class, update.class})
    private Long sceneId;

    @NotNull(message = "mobile参数缺失", groups = {create.class, update.class})
    @Length(max = 11, message = "mobile参数不能超出11个字符", groups = {create.class, update.class})
    private String mobile;

    @NotNull(message = "content参数缺失", groups = {create.class, update.class})
    @Length(max = 255, message = "content参数不能超出255个字符", groups = {create.class, update.class})
    private String content;

    @NotNull(message = "code参数缺失", groups = {create.class, update.class})
    @Length(max = 32, message = "code参数不能超出32个字符", groups = {create.class, update.class})
    private String code;

    @NotNull(message = "isVerify参数缺失", groups = {create.class, update.class})
    @IntegerContains(values = {0, 1}, message = "isVerify参数值不在符合范围", groups = {create.class, update.class})
    private Integer isVerify;

    @NotNull(message = "checkNum参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "checkNum参数值不能少于0", groups = {create.class, update.class})
    private Integer checkNum;

    @NotNull(message = "sendStatus参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "sendStatus参数值不能少于0", groups = {create.class, update.class})
    private Integer sendStatus;

    @NotNull(message = "sendTime参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "sendTime参数值不能少于0", groups = {create.class, update.class})
    private Integer sendTime;

    private String results;

}
